from pyecharts import Bar
from pyecharts import Pie


class Py_Echarts:

    def bar(self, x, y, name=None, table_name=None):

        bar = Bar(name)

        bar.add(table_name, x, y, is_label_show=True, is_datazoom_show=True)

        return bar


    def pie(self, x, y, name=None, table_name=None):

        pie = Pie(name)

        pie.add(table_name, x, y, is_label_show=True)

        return pie
